package city.spring.modules.medicalstation.medicationRecordDrug.repository;

import city.spring.modules.medicalstation.medicationRecordDrug.entity.MedicationRecordDrugExtEntity;
import city.spring.modules.medicalstation.medicationRecordDrug.vo.MedicationRecordDrugVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：
 *
 * @author 谢金婷
 * @date 2020-10-23 16:07:51
 */
@Repository
public interface MedicationRecordDrugExtRepository extends BaseMapper<MedicationRecordDrugExtEntity> {
    /**
     * 获取用药记录的药品列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<MedicationRecordDrugVO> getMedicationRecors(@Param(Constants.WRAPPER) Wrapper<? extends MedicationRecordDrugExtEntity> wrapper);

    /**
     * 获取出库的药品列表
     *
     * @param medicationrecordId 用药记录ID
     * @return
     */
    List<MedicationRecordDrugVO> getRecordDrugs(String medicationrecordId);

    /**
     * 获取出库的某个药品
     *
     * @param medicationrecordId 用药记录ID
     * @param extId              主键ID
     * @return
     */
    MedicationRecordDrugVO getRecordDrug(String medicationrecordId, String extId);

}